/**
 * 
 * @author danielshalev
 *
 */
public class Aggressive extends ComputerControlled {
	private int shotCounter;
	/**
	 * constructor
	 */
	public Aggressive() {
		super();
		shotCounter=TURNS_PER_SHOOT;
	}

	@Override
	public void doAction(SpaceWars game) {
		
		//the moving action of this turn
		this.goAfterSpaceShip(game);
		
		//if the closest ship angle to this ship is less then 0.2 in radians shoot 
		if(Math.abs(game.getClosestShipTo(this).getPhysics().angleTo(this.getPhysics()))<=CLOSEST_SHIP_CONDITION){
			shotCounter=this.shooting(game,shotCounter);
		}
		
		//the ship is regaining energy every round
		this.setEnergy(REGAINED_ENERGY);
	}

}
